<template>
  <div>
    <document :archiveeId="`${archiveeId}`" @refresh="getList"></document>

    <div>
      <pagination
        v-show="total > 0"
        :total="total"
        :page.sync="queryParams.page"
        :limit.sync="queryParams.size"
        @pagination="getList"
      />

      <!-- <div>
        {{ archiveeId }}
        {{ tableData }}
      </div> -->

      <document
        v-for="(item, index) in tableData"
        :key="index"
        :archiveeId="`${archiveeId}`"
        :item="item"
      ></document>
    </div>
  </div>
</template>

<script>
import document from "./document.vue";
import { archiveeService } from "@/api/sysService";
export default {
  props: ["archiveeId"],
  components: {
    document,
  },
  data() {
    return {
      total: 0,
      // 用户表格数据
      tableData: [],
      // 查询参数
      queryParams: {
        page: 1,
        size: 5,
      },
    };
  },

  created() {
    this.getList();
  },
  methods: {
    getList() {
      archiveeService
        .listDocument({ ...this.queryParams, archiveeId: this.archiveeId })
        .then((res) => {
          console.log(res);
          this.tableData = res.data.data;
          this.total = res.data.total;
        });
    },
  },
};
</script>

<style lang="scss" scoped></style>
